package com.helloworld.springcloud.controller;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONString;
import com.helloworld.springcloud.dao.CreditChannelInfoDao;
import com.helloworld.springcloud.entity.CreditChannelInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * Copyright (C), XXX 软件公司
 * FileName: TestController
 * Author:   sisyphus
 * Date:     2021/7/21
 * Description:
 */

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    CreditChannelInfoDao creditChannelInfoDao;

    @GetMapping("v1")
    public List<CreditChannelInfo> test(){
        List<CreditChannelInfo> lhyh = creditChannelInfoDao.queryByDateAndChannel(new Date(), "lhyh");
        System.out.println(com.alibaba.fastjson.JSONObject.toJSON(lhyh));
        return lhyh;
    }

}
